home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-17  |  3.7 KB  |  144 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __TOOLUTILS__
  18. #define __TOOLUTILS__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __QUICKDRAW__
  27. #include <Quickdraw.h>
  28. #endif
  29. /*    #include <MixedMode.h>                                        */
  30. /*    #include <QuickdrawText.h>                                    */
  31.  
  32. #ifndef __TEXTUTILS__
  33. #include <TextUtils.h>
  34. #endif
  35. /*    #include <Script.h>                                            */
  36. /*        #include <IntlResources.h>                                */
  37. /*        #include <Events.h>                                        */
  38. /*            #include <OSUtils.h>                                */
  39.  
  40. #ifndef __FIXMATH__
  41. #include <FixMath.h>
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48. #if GENERATINGPOWERPC
  49. #pragma options align=mac68k
  50. #endif
  51.  
  52. #ifdef __CFM68K__
  53. #pragma lib_export on
  54. #endif
  55.  
  56.  
  57. enum {
  58.     sysPatListID                = 0,
  59.     iBeamCursor                    = 1,
  60.     crossCursor                    = 2,
  61.     plusCursor                    = 3,
  62.     watchCursor                    = 4
  63. };
  64.  
  65. struct Int64Bit {
  66.     long                            hiLong;
  67.     unsigned long                    loLong;
  68. };
  69. typedef struct Int64Bit Int64Bit;
  70.  
  71. extern pascal Fixed FixRatio(short numer, short denom)
  72.  ONEWORDINLINE(0xA869);
  73. extern pascal Fixed FixMul(Fixed a, Fixed b)
  74.  ONEWORDINLINE(0xA868);
  75. extern pascal short FixRound(Fixed x)
  76.  ONEWORDINLINE(0xA86C);
  77. extern pascal void PackBits(Ptr *srcPtr, Ptr *dstPtr, short srcBytes)
  78.  ONEWORDINLINE(0xA8CF);
  79. extern pascal void UnpackBits(Ptr *srcPtr, Ptr *dstPtr, short dstBytes)
  80.  ONEWORDINLINE(0xA8D0);
  81. extern pascal Boolean BitTst(const void *bytePtr, long bitNum)
  82.  ONEWORDINLINE(0xA85D);
  83. extern pascal void BitSet(void *bytePtr, long bitNum)
  84.  ONEWORDINLINE(0xA85E);
  85. extern pascal void BitClr(void *bytePtr, long bitNum)
  86.  ONEWORDINLINE(0xA85F);
  87. extern pascal long BitAnd(long value1, long value2)
  88.  ONEWORDINLINE(0xA858);
  89. extern pascal long BitOr(long value1, long value2)
  90.  ONEWORDINLINE(0xA85B);
  91. extern pascal long BitXor(long value1, long value2)
  92.  ONEWORDINLINE(0xA859);
  93. extern pascal long BitNot(long value)
  94.  ONEWORDINLINE(0xA85A);
  95. extern pascal long BitShift(long value, short count)
  96.  ONEWORDINLINE(0xA85C);
  97. #if GENERATING68K
  98. extern pascal void LongMul(long a, long b, Int64Bit *result)
  99.  ONEWORDINLINE(0xA867);
  100. #else
  101. #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  102. #endif
  103. extern pascal Handle GetIcon(short iconID)
  104.  ONEWORDINLINE(0xA9BB);
  105. extern pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  106.  ONEWORDINLINE(0xA94B);
  107. extern pascal PatHandle GetPattern(short patternID)
  108.  ONEWORDINLINE(0xA9B8);
  109. extern pascal CursHandle GetCursor(short cursorID)
  110.  ONEWORDINLINE(0xA9B9);
  111. extern pascal PicHandle GetPicture(short pictureID)
  112.  ONEWORDINLINE(0xA9BC);
  113. extern pascal Fixed SlopeFromAngle(short angle)
  114.  ONEWORDINLINE(0xA8BC);
  115. extern pascal short AngleFromSlope(Fixed slope)
  116.  ONEWORDINLINE(0xA8C4);
  117. extern pascal long DeltaPoint(Point ptA, Point ptB)
  118.  ONEWORDINLINE(0xA94F);
  119. extern pascal void ShieldCursor(const Rect *shieldRect, Point offsetPt)
  120.  ONEWORDINLINE(0xA855);
  121. extern pascal void ScreenRes(short *scrnHRes, short *scrnVRes)
  122.  SIXWORDINLINE(0x225F, 0x32B8, 0x0102, 0x225F, 0x32B8, 0x0104);
  123. extern pascal void GetIndPattern(Pattern *thePat, short patternListID, short index);
  124. #if CGLUESUPPORTED
  125. extern void shieldcursor(const Rect *shieldRect, Point *offsetPt);
  126. extern long deltapoint(Point *ptA, Point *ptB);
  127. #endif
  128. #define HiWord(x) ((short)((long)(x) >> 16))
  129. #define LoWord(x) ((short)(x))
  130.  
  131. #ifdef __CFM68K__
  132. #pragma lib_export off
  133. #endif
  134.  
  135. #if GENERATINGPOWERPC
  136. #pragma options align=reset
  137. #endif
  138.  
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142.  
  143. #endif /* __TOOLUTILS__ */
  144.